﻿#ifndef __AVOID_CONTROL_PASSWORD_HEAD_FILE_INCLUDED__
#define __AVOID_CONTROL_PASSWORD_HEAD_FILE_INCLUDED__
#include "ctlSingleEdit.h"

namespace swui
{
#pragma warning(push)
#pragma warning(disable:4250)
	class ctlPassword : public ctlSingleEdit
	{
	public:
		static const ctlControlType uniqueType = ctlControlType::ctlPassword;
	public:
		virtual ~ctlPassword() { destroy(); }
		bool create(ctlRoot* parent, ctlPoint pos, unsigned width, 
			const ctlText& lpszText = ctlText(L""),
			const ctlStyleEdit& = ctlStyleEdit(ctlStyleEdit::common));
	public:
		virtual unsigned getANSITextSize();
		virtual unsigned getText(char* lpszText, unsigned bufferLen = 0);
		virtual unsigned getText(std::wstring::pointer lpszText, unsigned bufferLen = 0);
		virtual std::string getText();
		virtual std::wstring getWideText();
	private:
		virtual void _key_event_(ctlKeyEvent*);
	private:
		virtual _exactPos _insert_text(_exactPos pos, const _ctlInterior::textpack& text);
		virtual void _remove_selected();
		_ctlInterior::textpack _password_pack;
	};
#pragma warning(pop)
}

#endif